package com.cj.cms.web.security;

import org.springframework.beans.factory.annotation.Autowired;

import com.cj.cms.entity.Template;
import com.cj.cms.service.TemplateManager;
import com.cj.common.orm.hibernate.EntityManager;
import com.cj.common.web.struts2.CRUDActionSupport;

public class TemplateAction extends CRUDActionSupport<Template>{
	@Autowired
	private TemplateManager templateManager;

	@Override
	public EntityManager getEntityManager() {
		return templateManager;
	}
	protected void prepareModel() throws Exception{
		if (getId() != null) {
			entity = templateManager.get(getId());
		} else {
			entity = new Template();
		}
	}

}
